

/**
 * @file LinearCombinations.cpp
 * This class defines handy linear combinations of GDS data.
 */

//============================================================================
//
//  This file is part of GPSTk, the GPS Toolkit.
//
//  The GPSTk is free software; you can redistribute it and/or modify
//  it under the terms of the GNU Lesser General Public License as published
//  by the Free Software Foundation; either version 2.1 of the License, or
//  any later version.
//
//  The GPSTk is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU Lesser General Public License for more details.
//
//  You should have received a copy of the GNU Lesser General Public
//  License along with GPSTk; if not, write to the Free Software Foundation,
//  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
//
//  Dagoberto Salazar - gAGE ( http://www.gage.es ). 2007, 2008, 2009
//
//============================================================================


#include "LinearCombinations.hpp"


namespace gpstk
{

    LinearCombinations::LinearCombinations()
    {
         // Coefficients of GPS Q combinations, L1 and L2
        const double xg12( ( GAMMA_GPS_L1L2 + 1.0 )/( GAMMA_GPS_L1L2 - 1.0 ) );
        const double yg12( ( 2.0                  )/( GAMMA_GPS_L1L2 - 1.0 ) );
        const double zg12( ( 2.0 * GAMMA_GPS_L1L2 )/( GAMMA_GPS_L1L2 - 1.0 ) );

         // Coefficients of GPS Q combinations, L1 and L5
        const double xg15( ( GAMMA_GPS_L1L5 + 1.0 )/( GAMMA_GPS_L1L5 - 1.0 ) );
        const double yg15( ( 2.0                  )/( GAMMA_GPS_L1L5 - 1.0 ) );
        const double zg15( ( 2.0 * GAMMA_GPS_L1L5 )/( GAMMA_GPS_L1L5 - 1.0 ) );


         // Coefficients of Galileo Q combinations, E1 and E5a
        const double xe( ( GAMMA_GAL_L1L5 + 1.0 )/( GAMMA_GAL_L1L5 - 1.0 ) );
        const double ye( ( 2.0                  )/( GAMMA_GAL_L1L5 - 1.0 ) );
        const double ze( ( 2.0 * GAMMA_GAL_L1L5 )/( GAMMA_GAL_L1L5 - 1.0 ) );


         // Coefficients of BDS Q combinations, B1 and B2
        const double xc( ( GAMMA_BDS_L2L7 + 1.0 )/( GAMMA_BDS_L2L7 - 1.0 ) );
        const double yc( ( 2.0                  )/( GAMMA_BDS_L2L7 - 1.0 ) );
        const double zc( ( 2.0 * GAMMA_BDS_L2L7 )/( GAMMA_BDS_L2L7 - 1.0 ) );


         // Definition to compute the code with minus ionospheric delays
         // in the GPS L1 frequency
        q1CombOfGPSL1L2.header              =   TypeID::Q1OfL1L2;
        q1CombOfGPSL1L2.body[TypeID::C1]    =   +xg12;
        q1CombOfGPSL1L2.body[TypeID::C2]    =   -yg12;

         // Definition to compute the code with minus ionospheric delays
         // in the GPS L2 frequency
        q2CombOfGPSL1L2.header              =   TypeID::Q2OfL1L2;
        q2CombOfGPSL1L2.body[TypeID::C1]    =   +zg12;
        q2CombOfGPSL1L2.body[TypeID::C2]    =   -xg12;


         // Definition to compute the code with minus ionospheric delays
         // in the GPS L1 frequency
        q1CombOfGPSL1L5.header              =   TypeID::Q1OfL1L5;
        q1CombOfGPSL1L5.body[TypeID::C1]    =   +xg15;
        q1CombOfGPSL1L5.body[TypeID::C5]    =   -yg15;

         // Definition to compute the code with minus ionospheric delays
         // in the GPS L5 frequency
        q5CombOfGPSL1L5.header              =   TypeID::Q5OfL1L5;
        q5CombOfGPSL1L5.body[TypeID::C1]    =   +zg15;
        q5CombOfGPSL1L5.body[TypeID::C5]    =   -xg15;


         // Definition to compute the code with minus ionospheric delays

         // Definition to compute the code with minus ionospheric delays
         // in the Galileo L1 frequency
        q1CombOfGALL1L5.header              =   TypeID::Q1OfL1L5;
        q1CombOfGALL1L5.body[TypeID::C1]    =   +xe;
        q1CombOfGALL1L5.body[TypeID::C5]    =   -ye;

         // Definition to compute the code with minus ionospheric delays
         // in the Galileo L5 frequency
        q5CombOfGALL1L5.header              =   TypeID::Q5OfL1L5;
        q5CombOfGALL1L5.body[TypeID::C1]    =   +ze;
        q5CombOfGALL1L5.body[TypeID::C5]    =   -xe;


         // Definition to compute the code with minus ionospheric delays
         // in the BDS L2 frequency
        q2CombOfBDSL2L7.header              =   TypeID::Q2OfL2L7;
        q2CombOfBDSL2L7.body[TypeID::C2]    =   +xc;
        q2CombOfBDSL2L7.body[TypeID::C7]    =   -yc;

         // Definition to compute the code with minus ionospheric delays
         // in the BDS L7 frequency
        q7CombOfBDSL2L7.header              =   TypeID::Q7OfL2L7;
        q7CombOfBDSL2L7.body[TypeID::C2]    =   +zc;
        q7CombOfBDSL2L7.body[TypeID::C7]    =   -xc;



        // Coefficients of GPS PC/LC combinations, L1 and L2
        const double ag12( GAMMA_GPS_L1L2/( GAMMA_GPS_L1L2 - 1.0 ) );
        const double bg12( 1.0           /( GAMMA_GPS_L1L2 - 1.0 ) );

        // GPS

        // Coefficients of GPS PC/LC combinations, L1 and L5
        const double ag15( GAMMA_GPS_L1L5/( GAMMA_GPS_L1L5 - 1.0 ) );
        const double bg15( 1.0           /( GAMMA_GPS_L1L5 - 1.0 ) );

        // Galileo

        // Coefficients of Galileo PC/LC combinations, L1 and L5
        const double ae15( GAMMA_GAL_L1L5/( GAMMA_GAL_L1L5 - 1.0 ) );
        const double be15( 1.0           /( GAMMA_GAL_L1L5 - 1.0 ) );
        // Coefficients of Galileo PC/LC combinations, L1 and L7
        const double ae17( GAMMA_GAL_L1L7/( GAMMA_GAL_L1L7 - 1.0 ) );
        const double be17( 1.0           /( GAMMA_GAL_L1L7 - 1.0 ) );
        // Coefficients of Galileo PC/LC combinations, L1 and L8
        const double ae18( GAMMA_GAL_L1L8/( GAMMA_GAL_L1L8 - 1.0 ) );
        const double be18( 1.0           /( GAMMA_GAL_L1L8 - 1.0 ) );
        // Coefficients of Galileo PC/LC combinations, L1 and L6
        const double ae16( GAMMA_GAL_L1L6/( GAMMA_GAL_L1L6 - 1.0 ) );
        const double be16( 1.0           /( GAMMA_GAL_L1L6 - 1.0 ) );

        // BDS

        // Coefficients of BDS PC/LC combinations, L2 and L7
        const double ac27( GAMMA_BDS_L2L7/( GAMMA_BDS_L2L7 - 1.0 ) );
        const double bc27( 1.0           /( GAMMA_BDS_L2L7 - 1.0 ) );
        // Coefficients of BDS PC/LC combinations, L2 and L6
        const double ac26( GAMMA_BDS_L2L6/( GAMMA_BDS_L2L6 - 1.0 ) );
        const double bc26( 1.0           /( GAMMA_BDS_L2L6 - 1.0 ) );


         // Definition to compute PC combination of GPS, C1 and C2
        pc12CombOfGPS.header                =   TypeID::PC12;
        pc12CombOfGPS.body[TypeID::C1]      =   +ag12;
        pc12CombOfGPS.body[TypeID::C2]      =   -bg12;

         // Definition to compute LC combination of GPS, L1 and L2
        lc12CombOfGPS.header                =   TypeID::LC12;
        lc12CombOfGPS.body[TypeID::L1]      =   +ag12;
        lc12CombOfGPS.body[TypeID::L2]      =   -bg12;


         // Definition to compute PC combination of GPS, C1 and C5
        pc15CombOfGPS.header                =   TypeID::PC15;
        pc15CombOfGPS.body[TypeID::C1]      =   +ag15;
        pc15CombOfGPS.body[TypeID::C5]      =   -bg15;

         // Definition to compute LC combination of GPS, L1 and L5
        lc15CombOfGPS.header                =   TypeID::LC15;
        lc15CombOfGPS.body[TypeID::L1]      =   +ag15;
        lc15CombOfGPS.body[TypeID::L5]      =   -bg15;

        gfifCombOfGPS.header                =   TypeID::GFIF;
        gfifCombOfGPS.body[TypeID::LC12]    =   -1.0;
        gfifCombOfGPS.body[TypeID::LC15]    =   +1.0;


         // Definition to compute PC combination of Galileo, C1 and C5
        pc15CombOfGAL.header                =   TypeID::PC15;
        pc15CombOfGAL.body[TypeID::C1]      =   +ae15;
        pc15CombOfGAL.body[TypeID::C5]      =   -be15;

        pc17CombOfGAL.header                =   TypeID::PC17;
        pc17CombOfGAL.body[TypeID::C1]      =   +ae17;
        pc17CombOfGAL.body[TypeID::C7]      =   -be17;

        // pc18CombOfGAL
        pc18CombOfGAL.header                =   TypeID::PC18;
        pc18CombOfGAL.body[TypeID::C1]      =   +ae18;
        pc18CombOfGAL.body[TypeID::C8]      =   -be18;

        pc16CombOfGAL.header                =   TypeID::PC16;
        pc16CombOfGAL.body[TypeID::C1]      =   +ae16;
        pc16CombOfGAL.body[TypeID::C6]      =   -be16;

         // Definition to compute LC combination of Galileo, L1 and L5
        lc15CombOfGAL.header                =   TypeID::LC15;
        lc15CombOfGAL.body[TypeID::L1]      =   +ae15;
        lc15CombOfGAL.body[TypeID::L5]      =   -be15;

        lc17CombOfGAL.header                =   TypeID::LC17;
        lc17CombOfGAL.body[TypeID::L1]      =   +ae17;
        lc17CombOfGAL.body[TypeID::L7]      =   -be17;

        lc18CombOfGAL.header                =   TypeID::LC18;
        lc18CombOfGAL.body[TypeID::L1]      =   +ae18;
        lc18CombOfGAL.body[TypeID::L8]      =   -be18;

        lc16CombOfGAL.header                =   TypeID::LC16;
        lc16CombOfGAL.body[TypeID::L1]      =   +ae16;
        lc16CombOfGAL.body[TypeID::L6]      =   -be16;


         // Definition to compute PC combination of BDS, C2 and C7
        pc27CombOfBDS.header                =   TypeID::PC27;
        pc27CombOfBDS.body[TypeID::C2]      =   +ac27;
        pc27CombOfBDS.body[TypeID::C7]      =   -bc27;

        pc26CombOfBDS.header                =   TypeID::PC26;
        pc26CombOfBDS.body[TypeID::C2]      =   +ac26;
        pc26CombOfBDS.body[TypeID::C6]      =   -bc26;

         // Definition to compute LC combination of BDS, L2 and L7
        lc27CombOfBDS.header                =   TypeID::LC27;
        lc27CombOfBDS.body[TypeID::L2]      =   +ac27;
        lc27CombOfBDS.body[TypeID::L7]      =   -bc27;

        lc26CombOfBDS.header                =   TypeID::LC26;
        lc26CombOfBDS.body[TypeID::L2]      =   +ac26;
        lc26CombOfBDS.body[TypeID::L6]      =   -bc26;


         // Definition to compute PI combination of GPS, C1 and C2
        pi12CombOfGPS.header                =   TypeID::PI12;
        pi12CombOfGPS.body[TypeID::C1]      =   -1.0;
        pi12CombOfGPS.body[TypeID::C2]      =   +1.0;

         // Definition to compute LI combination of GPS, L1 and L2
        li12CombOfGPS.header                =   TypeID::LI12;
        li12CombOfGPS.body[TypeID::L1]      =   +1.0;
        li12CombOfGPS.body[TypeID::L2]      =   -1.0;


         // Definition to compute PI combination of GPS, C1 and C5
        pi15CombOfGPS.header                =   TypeID::PI15;
        pi15CombOfGPS.body[TypeID::C1]      =   -1.0;
        pi15CombOfGPS.body[TypeID::C5]      =   +1.0;

         // Definition to compute LI combination of GPS, L1 and L5
        li15CombOfGPS.header                =   TypeID::LI15;
        li15CombOfGPS.body[TypeID::L1]      =   +1.0;
        li15CombOfGPS.body[TypeID::L5]      =   -1.0;


         // Definition to compute PI combination of Galileo, C1 and C5
        pi15CombOfGAL.header                =   TypeID::PI15;
        pi15CombOfGAL.body[TypeID::C1]      =   -1.0;
        pi15CombOfGAL.body[TypeID::C5]      =   +1.0;

        pi17CombOfGAL.header                =   TypeID::PI17;
        pi17CombOfGAL.body[TypeID::C1]      =   -1.0;
        pi17CombOfGAL.body[TypeID::C7]      =   +1.0;

        pi18CombOfGAL.header                =   TypeID::PI18;
        pi18CombOfGAL.body[TypeID::C1]      =   -1.0;
        pi18CombOfGAL.body[TypeID::C8]      =   +1.0;

        pi16CombOfGAL.header                =   TypeID::PI16;
        pi16CombOfGAL.body[TypeID::C1]      =   -1.0;
        pi16CombOfGAL.body[TypeID::C6]      =   +1.0;

         // Definition to compute LI combination of Galileo, L1 and L5
        li15CombOfGAL.header                =   TypeID::LI15;
        li15CombOfGAL.body[TypeID::L1]      =   +1.0;
        li15CombOfGAL.body[TypeID::L5]      =   -1.0;

        li17CombOfGAL.header                =   TypeID::LI17;
        li17CombOfGAL.body[TypeID::L1]      =   +1.0;
        li17CombOfGAL.body[TypeID::L7]      =   -1.0;

        li18CombOfGAL.header                =   TypeID::LI18;
        li18CombOfGAL.body[TypeID::L1]      =   +1.0;
        li18CombOfGAL.body[TypeID::L8]      =   -1.0;

        li16CombOfGAL.header                =   TypeID::LI16;
        li16CombOfGAL.body[TypeID::L1]      =   +1.0;
        li16CombOfGAL.body[TypeID::L6]      =   -1.0;


         // Definition to compute PI combination of BDS, C2 and C7
        pi27CombOfBDS.header                =   TypeID::PI27;
        pi27CombOfBDS.body[TypeID::C2]      =   -1.0;
        pi27CombOfBDS.body[TypeID::C7]      =   +1.0;

        pi26CombOfBDS.header                =   TypeID::PI26;
        pi26CombOfBDS.body[TypeID::C2]      =   -1.0;
        pi26CombOfBDS.body[TypeID::C6]      =   +1.0;

         // Definition to compute LI combination of BDS, L2 and L7
        li27CombOfBDS.header                =   TypeID::LI27;
        li27CombOfBDS.body[TypeID::L2]      =   +1.0;
        li27CombOfBDS.body[TypeID::L7]      =   -1.0;

        li26CombOfBDS.header                =   TypeID::LI26;
        li26CombOfBDS.body[TypeID::L2]      =   +1.0;
        li26CombOfBDS.body[TypeID::L6]      =   -1.0;


         // Coefficients of GPS PW/WL/PN/LN combinations, L1 and L2
        double cg12( L1_FREQ_GPS/(L1_FREQ_GPS - L2_FREQ_GPS) );
        double dg12( L2_FREQ_GPS/(L1_FREQ_GPS - L2_FREQ_GPS) );
        double eg12( L1_FREQ_GPS/(L1_FREQ_GPS + L2_FREQ_GPS) );
        double fg12( L2_FREQ_GPS/(L1_FREQ_GPS + L2_FREQ_GPS) );

         // Coefficients of GPS PW/WL/PN/LN combinations, L1 and L5
        double cg15( L1_FREQ_GPS/(L1_FREQ_GPS - L5_FREQ_GPS) );
        double dg15( L5_FREQ_GPS/(L1_FREQ_GPS - L5_FREQ_GPS) );
        double eg15( L1_FREQ_GPS/(L1_FREQ_GPS + L5_FREQ_GPS) );
        double fg15( L5_FREQ_GPS/(L1_FREQ_GPS + L5_FREQ_GPS) );

         // Coefficients of GPS PW/WL/PN/LN combinations, L2 and L5
        double cg25( L2_FREQ_GPS/(L2_FREQ_GPS - L5_FREQ_GPS) );
        double dg25( L5_FREQ_GPS/(L2_FREQ_GPS - L5_FREQ_GPS) );
        double eg25( L2_FREQ_GPS/(L2_FREQ_GPS + L5_FREQ_GPS) );
        double fg25( L5_FREQ_GPS/(L2_FREQ_GPS + L5_FREQ_GPS) );

         // Coefficients of Galileo PW/WL/PN/LN combinations, L1 and L5
        double ce15( L1_FREQ_GAL/(L1_FREQ_GAL - L5_FREQ_GAL) );
        double de15( L5_FREQ_GAL/(L1_FREQ_GAL - L5_FREQ_GAL) );
        double ee15( L1_FREQ_GAL/(L1_FREQ_GAL + L5_FREQ_GAL) );
        double fe15( L5_FREQ_GAL/(L1_FREQ_GAL + L5_FREQ_GAL) );

         // Coefficients of Galileo PW/WL/PN/LN combinations, L1 and L7
        double ce17( L1_FREQ_GAL/(L1_FREQ_GAL - L7_FREQ_GAL) );
        double de17( L7_FREQ_GAL/(L1_FREQ_GAL - L7_FREQ_GAL) );
        double ee17( L1_FREQ_GAL/(L1_FREQ_GAL + L7_FREQ_GAL) );
        double fe17( L7_FREQ_GAL/(L1_FREQ_GAL + L7_FREQ_GAL) );

         // Coefficients of Galileo PW/WL/PN/LN combinations, L1 and L8
        double ce18( L1_FREQ_GAL/(L1_FREQ_GAL - L8_FREQ_GAL) );
        double de18( L8_FREQ_GAL/(L1_FREQ_GAL - L8_FREQ_GAL) );
        double ee18( L1_FREQ_GAL/(L1_FREQ_GAL + L8_FREQ_GAL) );
        double fe18( L8_FREQ_GAL/(L1_FREQ_GAL + L8_FREQ_GAL) );

         // Coefficients of Galileo PW/WL/PN/LN combinations, L1 and L6
        double ce16( L1_FREQ_GAL/(L1_FREQ_GAL - L6_FREQ_GAL) );
        double de16( L6_FREQ_GAL/(L1_FREQ_GAL - L6_FREQ_GAL) );
        double ee16( L1_FREQ_GAL/(L1_FREQ_GAL + L6_FREQ_GAL) );
        double fe16( L6_FREQ_GAL/(L1_FREQ_GAL + L6_FREQ_GAL) );

         // Coefficients of BDS PW/WL/PN/LN combinations, L2 and L7
        double cc27( L2_FREQ_BDS/(L2_FREQ_BDS - L7_FREQ_BDS) );
        double dc27( L7_FREQ_BDS/(L2_FREQ_BDS - L7_FREQ_BDS) );
        double ec27( L2_FREQ_BDS/(L2_FREQ_BDS + L7_FREQ_BDS) );
        double fc27( L7_FREQ_BDS/(L2_FREQ_BDS + L7_FREQ_BDS) );

         // Coefficients of BDS PW/WL/PN/LN combinations, L2 and L6
        double cc26( L2_FREQ_BDS/(L2_FREQ_BDS - L6_FREQ_BDS) );
        double dc26( L6_FREQ_BDS/(L2_FREQ_BDS - L6_FREQ_BDS) );
        double ec26( L2_FREQ_BDS/(L2_FREQ_BDS + L6_FREQ_BDS) );
        double fc26( L6_FREQ_BDS/(L2_FREQ_BDS + L6_FREQ_BDS) );


         // Definition to compute PW combination of GPS, C1 and C2
        pw12CombOfGPS.header                =   TypeID::PW12;
        pw12CombOfGPS.body[TypeID::C1]      =   +cg12;
        pw12CombOfGPS.body[TypeID::C2]      =   -dg12;

         // Definition to compute WL combination of GPS, L1 and L2
        lw12CombOfGPS.header                =   TypeID::WL12;
        lw12CombOfGPS.body[TypeID::L1]      =   +cg12;
        lw12CombOfGPS.body[TypeID::L2]      =   -dg12;


         // Definition to compute PW combination of GPS, C1 and C5
        pw15CombOfGPS.header                =   TypeID::PW15;
        pw15CombOfGPS.body[TypeID::C1]      =   +cg15;
        pw15CombOfGPS.body[TypeID::C5]      =   -dg15;

         // Definition to compute WL combination of GPS, L1 and L5
        lw15CombOfGPS.header                =   TypeID::WL15;
        lw15CombOfGPS.body[TypeID::L1]      =   +cg15;
        lw15CombOfGPS.body[TypeID::L5]      =   -dg15;


         // Definition to compute PW combination of Galileo, C1 and C5
        pw15CombOfGAL.header                =   TypeID::PW15;
        pw15CombOfGAL.body[TypeID::C1]      =   +ce15;
        pw15CombOfGAL.body[TypeID::C5]      =   -de15;

         // Definition to compute WL combination of Galileo, L1 and L5
        lw15CombOfGAL.header                =   TypeID::WL15;
        lw15CombOfGAL.body[TypeID::L1]      =   +ce15;
        lw15CombOfGAL.body[TypeID::L5]      =   -de15;


         // Definition to compute PW combination of BDS, C2 and C7
        pw27CombOfBDS.header                =   TypeID::PW27;
        pw27CombOfBDS.body[TypeID::C2]      =   +cc27;
        pw27CombOfBDS.body[TypeID::C7]      =   -dc27;

         // Definition to compute WL combination of BDS, L2 and L7
        lw27CombOfBDS.header                =   TypeID::WL27;
        lw27CombOfBDS.body[TypeID::L2]      =   +cc27;
        lw27CombOfBDS.body[TypeID::L7]      =   -dc27;


         // Definition to compute PN combination of GPS, C1 and C2
        pn12CombOfGPS.header                =   TypeID::PN12;
        pn12CombOfGPS.body[TypeID::C1]      =   +eg12;
        pn12CombOfGPS.body[TypeID::C2]      =   +fg12;

         // Definition to compute LN combination of GPS, L1 and L2
        ln12CombOfGPS.header                =   TypeID::LN12;
        ln12CombOfGPS.body[TypeID::L1]      =   +eg12;
        ln12CombOfGPS.body[TypeID::L2]      =   +fg12;


         // Definition to compute PN combination of GPS, C1 and C5
        pn15CombOfGPS.header                =   TypeID::PN15;
        pn15CombOfGPS.body[TypeID::C1]      =   +eg15;
        pn15CombOfGPS.body[TypeID::C5]      =   +fg15;

         // Definition to compute LN combination of GPS, L1 and L5
        ln15CombOfGPS.header                =   TypeID::LN15;
        ln15CombOfGPS.body[TypeID::L1]      =   +eg15;
        ln15CombOfGPS.body[TypeID::L2]      =   +fg15;


         // Definition to compute PN combination of Galileo, C1 and C5
        pn15CombOfGAL.header                =   TypeID::PN15;
        pn15CombOfGAL.body[TypeID::C1]      =   +ee15;
        pn15CombOfGAL.body[TypeID::C5]      =   +fe15;

         // Definition to compute LN combination of Galileo, L1 and L5
        ln15CombOfGAL.header                =   TypeID::LN15;
        ln15CombOfGAL.body[TypeID::L1]      =   +ee15;
        ln15CombOfGAL.body[TypeID::L5]      =   +fe15;


         // Definition to compute PN combination of BDS, C2 and C7
        pn27CombOfBDS.header                =   TypeID::PN27;
        pn27CombOfBDS.body[TypeID::C2]      =   +ec27;
        pn27CombOfBDS.body[TypeID::C7]      =   +fc27;

         // Definition to compute LN combination of BDS, C2 and C7
        ln27CombOfBDS.header                =   TypeID::LN27;
        ln27CombOfBDS.body[TypeID::L2]      =   +ec27;
        ln27CombOfBDS.body[TypeID::L7]      =   +fc27;




         // Definition to compute the MW combination of GPS, L1 and L2
        mw12CombOfGPS.header                =   TypeID::MW12;
        mw12CombOfGPS.body[TypeID::L1]      =   +cg12;
        mw12CombOfGPS.body[TypeID::L2]      =   -dg12;
        mw12CombOfGPS.body[TypeID::C1]      =   -eg12;
        mw12CombOfGPS.body[TypeID::C2]      =   -fg12;

         // Definition to compute the MW combination of GPS, L1 and L5
        mw15CombOfGPS.header                =   TypeID::MW15;
        mw15CombOfGPS.body[TypeID::L1]      =   +cg15;
        mw15CombOfGPS.body[TypeID::L5]      =   -dg15;
        mw15CombOfGPS.body[TypeID::C1]      =   -eg15;
        mw15CombOfGPS.body[TypeID::C5]      =   -fg15;

         // Definition to compute the MW combination of GPS, L2 and L5
        mw25CombOfGPS.header                =   TypeID::MW25;
        mw25CombOfGPS.body[TypeID::L2]      =   +cg25;
        mw25CombOfGPS.body[TypeID::L5]      =   -dg25;
        mw25CombOfGPS.body[TypeID::C2]      =   -eg25;
        mw25CombOfGPS.body[TypeID::C5]      =   -fg25;

         // Definition to compute the MW combination of Galileo, L1 and L5
        mw15CombOfGAL.header                =   TypeID::MW15;
        mw15CombOfGAL.body[TypeID::L1]      =   +ce15;
        mw15CombOfGAL.body[TypeID::L5]      =   -de15;
        mw15CombOfGAL.body[TypeID::C1]      =   -ee15;
        mw15CombOfGAL.body[TypeID::C5]      =   -fe15;

        mw17CombOfGAL.header                =   TypeID::MW17;
        mw17CombOfGAL.body[TypeID::L1]      =   +ce17;
        mw17CombOfGAL.body[TypeID::L7]      =   -de17;
        mw17CombOfGAL.body[TypeID::C1]      =   -ee17;
        mw17CombOfGAL.body[TypeID::C7]      =   -fe17;

        mw18CombOfGAL.header                =   TypeID::MW18;
        mw18CombOfGAL.body[TypeID::L1]      =   +ce18;
        mw18CombOfGAL.body[TypeID::L8]      =   -de18;
        mw18CombOfGAL.body[TypeID::C1]      =   -ee18;
        mw18CombOfGAL.body[TypeID::C8]      =   -fe18;

        mw16CombOfGAL.header                =   TypeID::MW16;
        mw16CombOfGAL.body[TypeID::L1]      =   +ce16;
        mw16CombOfGAL.body[TypeID::L6]      =   -de16;
        mw16CombOfGAL.body[TypeID::C1]      =   -ee16;
        mw16CombOfGAL.body[TypeID::C6]      =   -fe16;

         // Definition to compute the MW combination of BDS, L2 and L7
        mw27CombOfBDS.header                =   TypeID::MW27;
        mw27CombOfBDS.body[TypeID::L2]      =   +cc27;
        mw27CombOfBDS.body[TypeID::L7]      =   -dc27;
        mw27CombOfBDS.body[TypeID::C2]      =   -ec27;
        mw27CombOfBDS.body[TypeID::C7]      =   -fc27;

         // Definition to compute the MW combination of BDS, L2 and L6
        mw26CombOfBDS.header                =   TypeID::MW26;
        mw26CombOfBDS.body[TypeID::L2]      =   +cc26;
        mw26CombOfBDS.body[TypeID::L6]      =   -dc26;
        mw26CombOfBDS.body[TypeID::C2]      =   -ec26;
        mw26CombOfBDS.body[TypeID::C6]      =   -fc26;


         // Definition to compute prefit residual of GPS C1
        c1PrefitOfGPS.header                    =   TypeID::prefitC1;
        c1PrefitOfGPS.body[TypeID::C1]          =   +1.0;
        c1PrefitOfGPS.body[TypeID::rho]         =   -1.0;
        c1PrefitOfGPS.body[TypeID::cdtSat]      =   +1.0;
        c1PrefitOfGPS.body[TypeID::relativity]  =   -1.0;
        c1PrefitOfGPS.body[TypeID::satPCenter]  =   -1.0;
        c1PrefitOfGPS.body[TypeID::gravDelay]   =   -1.0;
        c1PrefitOfGPS.body[TypeID::tropoSlant]  =   -1.0;
        c1PrefitOfGPS.body[TypeID::rcvCorr1]    =   -1.0;

         // Definition to compute prefit residual of GPS C2
        c2PrefitOfGPS.header                    =   TypeID::prefitC2;
        c2PrefitOfGPS.body[TypeID::C2]          =   +1.0;
        c2PrefitOfGPS.body[TypeID::rho]         =   -1.0;
        c2PrefitOfGPS.body[TypeID::cdtSat]      =   +1.0;
        c2PrefitOfGPS.body[TypeID::satPCenter]  =   -1.0;
        c2PrefitOfGPS.body[TypeID::relativity]  =   -1.0;
        c2PrefitOfGPS.body[TypeID::gravDelay]   =   -1.0;
        c2PrefitOfGPS.body[TypeID::tropoSlant]  =   -1.0;
        c2PrefitOfGPS.body[TypeID::rcvCorr2]    =   -1.0;


         // Definition to compute prefit residual of GPS C5
        c5PrefitOfGPS.header                    =   TypeID::prefitC5;
        c5PrefitOfGPS.body[TypeID::C5]          =   +1.0;
        c5PrefitOfGPS.body[TypeID::rho]         =   -1.0;
        c5PrefitOfGPS.body[TypeID::cdtSat]      =   +1.0;
        c5PrefitOfGPS.body[TypeID::satPCenter]  =   -1.0;
        c5PrefitOfGPS.body[TypeID::relativity]  =   -1.0;
        c5PrefitOfGPS.body[TypeID::gravDelay]   =   -1.0;
        c5PrefitOfGPS.body[TypeID::tropoSlant]  =   -1.0;
        c5PrefitOfGPS.body[TypeID::rcvCorr5]    =   -1.0;


         // Definition to compute prefit residual of Galileo C1
        c1PrefitOfGAL.header                    =   TypeID::prefitC1;
        c1PrefitOfGAL.body[TypeID::C1]          =   +1.0;
        c1PrefitOfGAL.body[TypeID::rho]         =   -1.0;
        c1PrefitOfGAL.body[TypeID::cdtSat]      =   +1.0;
        c1PrefitOfGAL.body[TypeID::satPCenter]  =   -1.0;
        c1PrefitOfGAL.body[TypeID::relativity]  =   -1.0;
        c1PrefitOfGAL.body[TypeID::gravDelay]   =   -1.0;
        c1PrefitOfGAL.body[TypeID::tropoSlant]  =   -1.0;
        c1PrefitOfGAL.body[TypeID::rcvCorr1]    =   -1.0;

         // Definition to compute prefit residual of Galileo C5
        c5PrefitOfGAL.header                    =   TypeID::prefitC5;
        c5PrefitOfGAL.body[TypeID::C5]          =   +1.0;
        c5PrefitOfGAL.body[TypeID::rho]         =   -1.0;
        c5PrefitOfGAL.body[TypeID::cdtSat]      =   +1.0;
        c5PrefitOfGAL.body[TypeID::satPCenter]  =   -1.0;
        c5PrefitOfGAL.body[TypeID::relativity]  =   -1.0;
        c5PrefitOfGAL.body[TypeID::gravDelay]   =   -1.0;
        c5PrefitOfGAL.body[TypeID::tropoSlant]  =   -1.0;
        c5PrefitOfGAL.body[TypeID::rcvCorr5]    =   -1.0;

         // Definition to compute prefit residual of Galileo C6
        c6PrefitOfGAL.header                    =   TypeID::prefitC6;
        c6PrefitOfGAL.body[TypeID::C6]          =   +1.0;
        c6PrefitOfGAL.body[TypeID::rho]         =   -1.0;
        c6PrefitOfGAL.body[TypeID::cdtSat]      =   +1.0;
        c6PrefitOfGAL.body[TypeID::satPCenter]  =   -1.0;
        c6PrefitOfGAL.body[TypeID::relativity]  =   -1.0;
        c6PrefitOfGAL.body[TypeID::gravDelay]   =   -1.0;
        c6PrefitOfGAL.body[TypeID::tropoSlant]  =   -1.0;
        c6PrefitOfGAL.body[TypeID::rcvCorr6]    =   -1.0;

         // Definition to compute prefit residual of Galileo C7
        c7PrefitOfGAL.header                    =   TypeID::prefitC7;
        c7PrefitOfGAL.body[TypeID::C7]          =   +1.0;
        c7PrefitOfGAL.body[TypeID::rho]         =   -1.0;
        c7PrefitOfGAL.body[TypeID::cdtSat]      =   +1.0;
        c7PrefitOfGAL.body[TypeID::satPCenter]  =   -1.0;
        c7PrefitOfGAL.body[TypeID::relativity]  =   -1.0;
        c7PrefitOfGAL.body[TypeID::gravDelay]   =   -1.0;
        c7PrefitOfGAL.body[TypeID::tropoSlant]  =   -1.0;
        c7PrefitOfGAL.body[TypeID::rcvCorr7]    =   -1.0;

         // Definition to compute prefit residual of Galileo C6
        c8PrefitOfGAL.header                    =   TypeID::prefitC8;
        c8PrefitOfGAL.body[TypeID::C8]          =   +1.0;
        c8PrefitOfGAL.body[TypeID::rho]         =   -1.0;
        c8PrefitOfGAL.body[TypeID::cdtSat]      =   +1.0;
        c8PrefitOfGAL.body[TypeID::satPCenter]  =   -1.0;
        c8PrefitOfGAL.body[TypeID::relativity]  =   -1.0;
        c8PrefitOfGAL.body[TypeID::gravDelay]   =   -1.0;
        c8PrefitOfGAL.body[TypeID::tropoSlant]  =   -1.0;
        c8PrefitOfGAL.body[TypeID::rcvCorr8]  =   -1.0;


         // Definition to compute prefit residual of BDS C2
        c2PrefitOfBDS.header                    =   TypeID::prefitC2;
        c2PrefitOfBDS.body[TypeID::C2]          =   +1.0;
        c2PrefitOfBDS.body[TypeID::rho]         =   -1.0;
        c2PrefitOfBDS.body[TypeID::cdtSat]      =   +1.0;
        c2PrefitOfBDS.body[TypeID::satPCenter]  =   -1.0;
        c2PrefitOfBDS.body[TypeID::relativity]  =   -1.0;
        c2PrefitOfBDS.body[TypeID::gravDelay]   =   -1.0;
        c2PrefitOfBDS.body[TypeID::tropoSlant]  =   -1.0;
        c2PrefitOfBDS.body[TypeID::rcvCorr2]    =   -1.0;

         // Definition to compute prefit residual of BDS C7
        c7PrefitOfBDS.header                    =   TypeID::prefitC7;
        c7PrefitOfBDS.body[TypeID::C7]          =   +1.0;
        c7PrefitOfBDS.body[TypeID::rho]         =   -1.0;
        c7PrefitOfBDS.body[TypeID::cdtSat]      =   +1.0;
        c7PrefitOfBDS.body[TypeID::satPCenter]  =   -1.0;
        c7PrefitOfBDS.body[TypeID::relativity]  =   -1.0;
        c7PrefitOfBDS.body[TypeID::gravDelay]   =   -1.0;
        c7PrefitOfBDS.body[TypeID::tropoSlant]  =   -1.0;
        c7PrefitOfBDS.body[TypeID::rcvCorr7]    =   -1.0;

         // Definition to compute prefit residual of Galileo C6
        c6PrefitOfBDS.header                    =   TypeID::prefitC6;
        c6PrefitOfBDS.body[TypeID::C6]          =   +1.0;
        c6PrefitOfBDS.body[TypeID::rho]         =   -1.0;
        c6PrefitOfBDS.body[TypeID::cdtSat]      =   +1.0;
        c6PrefitOfBDS.body[TypeID::satPCenter]  =   -1.0;
        c6PrefitOfBDS.body[TypeID::relativity]  =   -1.0;
        c6PrefitOfBDS.body[TypeID::gravDelay]   =   -1.0;
        c6PrefitOfBDS.body[TypeID::tropoSlant]  =   -1.0;
        c6PrefitOfBDS.body[TypeID::rcvCorr6]    =   -1.0;



         // Definition to compute prefit residual of GPS L1
        l1PrefitOfGPS.header                    =   TypeID::prefitL1;
        l1PrefitOfGPS.body[TypeID::L1]          =   +1.0;
        l1PrefitOfGPS.body[TypeID::rho]         =   -1.0;
        l1PrefitOfGPS.body[TypeID::cdtSat]      =   +1.0;
        l1PrefitOfGPS.body[TypeID::satPCenter]  =   -1.0;
        l1PrefitOfGPS.body[TypeID::relativity]  =   -1.0;
        l1PrefitOfGPS.body[TypeID::gravDelay]   =   -1.0;
        l1PrefitOfGPS.body[TypeID::tropoSlant]  =   -1.0;
        l1PrefitOfGPS.body[TypeID::windUp]      =   -L1_WAVELENGTH_GPS/TWO_PI;
        l1PrefitOfGPS.body[TypeID::updL1]       =   -1.0;
        l1PrefitOfGPS.body[TypeID::rcvCorr1]    =   -1.0;

         // Definition to compute prefit residual of GPS L2
        l2PrefitOfGPS.header                      =   TypeID::prefitL2;
        l2PrefitOfGPS.body[TypeID::L2]            =   +1.0;
        l2PrefitOfGPS.body[TypeID::rho]           =   -1.0;
        l2PrefitOfGPS.body[TypeID::cdtSat]        =   +1.0;
        l2PrefitOfGPS.body[TypeID::satPCenter]    =   -1.0;
        l2PrefitOfGPS.body[TypeID::relativity]    =   -1.0;
        l2PrefitOfGPS.body[TypeID::gravDelay]     =   -1.0;
        l2PrefitOfGPS.body[TypeID::tropoSlant]    =   -1.0;
        l2PrefitOfGPS.body[TypeID::windUp]        =   -L2_WAVELENGTH_GPS/TWO_PI;
        l2PrefitOfGPS.body[TypeID::updL2]         =   -1.0;
        l2PrefitOfGPS.body[TypeID::rcvCorr2]      =   -1.0;

         // Definition to compute prefit residual of GPS L5
        l5PrefitOfGPS.header                      =   TypeID::prefitL5;
        l5PrefitOfGPS.body[TypeID::L5]            =   +1.0;
        l5PrefitOfGPS.body[TypeID::rho]           =   -1.0;
        l5PrefitOfGPS.body[TypeID::cdtSat]        =   +1.0;
        l5PrefitOfGPS.body[TypeID::satPCenter]    =   -1.0;
        l5PrefitOfGPS.body[TypeID::relativity]    =   -1.0;
        l5PrefitOfGPS.body[TypeID::gravDelay]     =   -1.0;
        l5PrefitOfGPS.body[TypeID::tropoSlant]    =   -1.0;
        l5PrefitOfGPS.body[TypeID::windUp]        =   -L5_WAVELENGTH_GPS/TWO_PI;
        l5PrefitOfGPS.body[TypeID::updL5]         =   -1.0;
        l5PrefitOfGPS.body[TypeID::rcvCorr5]      =   -1.0;


         // Definition to compute prefit residual of Galileo L1
        l1PrefitOfGAL.header                      =   TypeID::prefitL1;
        l1PrefitOfGAL.body[TypeID::L1]            =   +1.0;
        l1PrefitOfGAL.body[TypeID::rho]           =   -1.0;
        l1PrefitOfGAL.body[TypeID::cdtSat]        =   +1.0;
        l1PrefitOfGAL.body[TypeID::satPCenter]    =   -1.0;
        l1PrefitOfGAL.body[TypeID::relativity]    =   -1.0;
        l1PrefitOfGAL.body[TypeID::gravDelay]     =   -1.0;
        l1PrefitOfGAL.body[TypeID::tropoSlant]    =   -1.0;
        l1PrefitOfGAL.body[TypeID::windUp]        =   -L1_WAVELENGTH_GAL/TWO_PI;
        l1PrefitOfGAL.body[TypeID::updL1]         =   -1.0;
        l1PrefitOfGAL.body[TypeID::rcvCorr1]      =   -1.0;

         // Definition to compute prefit residual of Galileo L5
        l5PrefitOfGAL.header                      =   TypeID::prefitL5;
        l5PrefitOfGAL.body[TypeID::L5]            =   +1.0;
        l5PrefitOfGAL.body[TypeID::rho]           =   -1.0;
        l5PrefitOfGAL.body[TypeID::cdtSat]        =   +1.0;
        l5PrefitOfGAL.body[TypeID::satPCenter]    =   -1.0;
        l5PrefitOfGAL.body[TypeID::relativity]    =   -1.0;
        l5PrefitOfGAL.body[TypeID::gravDelay]     =   -1.0;
        l5PrefitOfGAL.body[TypeID::tropoSlant]    =   -1.0;
        l5PrefitOfGAL.body[TypeID::windUp]        =   -L5_WAVELENGTH_GAL/TWO_PI;
        l5PrefitOfGAL.body[TypeID::updL5]         =   -1.0;
        l5PrefitOfGAL.body[TypeID::rcvCorr5]      =   -1.0;

         // Definition to compute prefit residual of Galileo L6
        l6PrefitOfGAL.header                      =   TypeID::prefitL6;
        l6PrefitOfGAL.body[TypeID::L6]            =   +1.0;
        l6PrefitOfGAL.body[TypeID::rho]           =   -1.0;
        l6PrefitOfGAL.body[TypeID::cdtSat]        =   +1.0;
        l6PrefitOfGAL.body[TypeID::satPCenter]    =   -1.0;
        l6PrefitOfGAL.body[TypeID::relativity]    =   -1.0;
        l6PrefitOfGAL.body[TypeID::gravDelay]     =   -1.0;
        l6PrefitOfGAL.body[TypeID::tropoSlant]    =   -1.0;
        l6PrefitOfGAL.body[TypeID::windUp]        =   -L6_WAVELENGTH_GAL/TWO_PI;
        l6PrefitOfGAL.body[TypeID::updL6]         =   -1.0;
        l6PrefitOfGAL.body[TypeID::rcvCorr6]      =   -1.0;

         // Definition to compute prefit residual of Galileo L7
        l7PrefitOfGAL.header                      =   TypeID::prefitL7;
        l7PrefitOfGAL.body[TypeID::L7]            =   +1.0;
        l7PrefitOfGAL.body[TypeID::rho]           =   -1.0;
        l7PrefitOfGAL.body[TypeID::cdtSat]        =   +1.0;
        l7PrefitOfGAL.body[TypeID::satPCenter]    =   -1.0;
        l7PrefitOfGAL.body[TypeID::relativity]    =   -1.0;
        l7PrefitOfGAL.body[TypeID::gravDelay]     =   -1.0;
        l7PrefitOfGAL.body[TypeID::tropoSlant]    =   -1.0;
        l7PrefitOfGAL.body[TypeID::windUp]        =   -L7_WAVELENGTH_GAL/TWO_PI;
        l7PrefitOfGAL.body[TypeID::updL7]         =   -1.0;
        l7PrefitOfGAL.body[TypeID::rcvCorr7]      =   -1.0;

         // Definition to compute prefit residual of Galileo L8
        l8PrefitOfGAL.header                      =   TypeID::prefitL8;
        l8PrefitOfGAL.body[TypeID::L8]            =   +1.0;
        l8PrefitOfGAL.body[TypeID::rho]           =   -1.0;
        l8PrefitOfGAL.body[TypeID::cdtSat]        =   +1.0;
        l8PrefitOfGAL.body[TypeID::satPCenter]    =   -1.0;
        l8PrefitOfGAL.body[TypeID::relativity]    =   -1.0;
        l8PrefitOfGAL.body[TypeID::gravDelay]     =   -1.0;
        l8PrefitOfGAL.body[TypeID::tropoSlant]    =   -1.0;
        l8PrefitOfGAL.body[TypeID::windUp]        =   -L8_WAVELENGTH_GAL/TWO_PI;
        l8PrefitOfGAL.body[TypeID::updL8]         =   -1.0;
        l8PrefitOfGAL.body[TypeID::rcvCorr8]      =   -1.0;



         // Definition to compute prefit residual of BDS L2
        l2PrefitOfBDS.header                      =   TypeID::prefitL2;
        l2PrefitOfBDS.body[TypeID::L2]            =   +1.0;
        l2PrefitOfBDS.body[TypeID::rho]           =   -1.0;
        l2PrefitOfBDS.body[TypeID::cdtSat]        =   +1.0;
        l2PrefitOfBDS.body[TypeID::satPCenter]    =   -1.0;
        l2PrefitOfBDS.body[TypeID::relativity]    =   -1.0;
        l2PrefitOfBDS.body[TypeID::gravDelay]     =   -1.0;
        l2PrefitOfBDS.body[TypeID::tropoSlant]    =   -1.0;
        l2PrefitOfBDS.body[TypeID::windUp]        =   -L2_WAVELENGTH_BDS/TWO_PI;
        l2PrefitOfBDS.body[TypeID::updL2]         =   -1.0;
        l2PrefitOfBDS.body[TypeID::rcvCorr2]      =   -1.0;

         // Definition to compute prefit residual of BDS L7
        l7PrefitOfBDS.header                      =   TypeID::prefitL7;
        l7PrefitOfBDS.body[TypeID::L7]            =   +1.0;
        l7PrefitOfBDS.body[TypeID::rho]           =   -1.0;
        l7PrefitOfBDS.body[TypeID::cdtSat]        =   +1.0;
        l7PrefitOfBDS.body[TypeID::satPCenter]    =   -1.0;
        l7PrefitOfBDS.body[TypeID::relativity]    =   -1.0;
        l7PrefitOfBDS.body[TypeID::gravDelay]     =   -1.0;
        l7PrefitOfBDS.body[TypeID::tropoSlant]    =   -1.0;
        l7PrefitOfBDS.body[TypeID::windUp]        =   -L7_WAVELENGTH_BDS/TWO_PI;
        l7PrefitOfBDS.body[TypeID::updL7]         =   -1.0;
        l7PrefitOfBDS.body[TypeID::rcvCorr7]      =   -1.0;

         // Definition to compute prefit residual of BDS L6
        l6PrefitOfBDS.header                      =   TypeID::prefitL6;
        l6PrefitOfBDS.body[TypeID::L6]            =   +1.0;
        l6PrefitOfBDS.body[TypeID::rho]           =   -1.0;
        l6PrefitOfBDS.body[TypeID::cdtSat]        =   +1.0;
        l6PrefitOfBDS.body[TypeID::satPCenter]    =   -1.0;
        l6PrefitOfBDS.body[TypeID::relativity]    =   -1.0;
        l6PrefitOfBDS.body[TypeID::gravDelay]     =   -1.0;
        l6PrefitOfBDS.body[TypeID::tropoSlant]    =   -1.0;
        l6PrefitOfBDS.body[TypeID::windUp]        =   -L6_WAVELENGTH_BDS/TWO_PI;
        l6PrefitOfBDS.body[TypeID::updL6]         =   -1.0;
        l6PrefitOfBDS.body[TypeID::rcvCorr6]      =   -1.0;


         // Definition to compute prefit residual of GPS PC, L1 + L2
        pc12PrefitOfGPS.header                    =   TypeID::prefitC12;
        pc12PrefitOfGPS.body[TypeID::prefitC1]    =   +ag12;
        pc12PrefitOfGPS.body[TypeID::prefitC2]    =   -bg12;


         // Definition to compute prefit residual of GPS LC, L1 + L2
        lc12PrefitOfGPS.header                    =   TypeID::prefitL12;
        lc12PrefitOfGPS.body[TypeID::prefitL1]    =   +ag12;
        lc12PrefitOfGPS.body[TypeID::prefitL2]    =   -bg12;

         // Definition to compute prefit residual of GPS PC, L1 + L5
        pc15PrefitOfGPS.header                    =   TypeID::prefitC15;
        pc15PrefitOfGPS.body[TypeID::prefitC1]    =   +ag15;
        pc15PrefitOfGPS.body[TypeID::prefitC5]    =   -bg15;

         // Definition to compute prefit residual of GPS LC, L1 + L5
        lc15PrefitOfGPS.header                    =   TypeID::prefitL15;
        lc15PrefitOfGPS.body[TypeID::prefitL1]    =   +ag15;
        lc15PrefitOfGPS.body[TypeID::prefitL5]    =   -bg15;

        // Galiloe-related

         // Definition to compute prefit residual of GAL PC, L1 + L5
        pc15PrefitOfGAL.header                    =   TypeID::prefitC15;
        pc15PrefitOfGAL.body[TypeID::prefitC1]    =   +ae15;
        pc15PrefitOfGAL.body[TypeID::prefitC5]    =   -be15;

        pc17PrefitOfGAL.header                    =   TypeID::prefitC17;
        pc17PrefitOfGAL.body[TypeID::prefitC1]    =   +ae17;
        pc17PrefitOfGAL.body[TypeID::prefitC7]    =   -be17;

        pc18PrefitOfGAL.header                    =   TypeID::prefitC18;
        pc18PrefitOfGAL.body[TypeID::prefitC1]    =   +ae18;
        pc18PrefitOfGAL.body[TypeID::prefitC8]    =   -be18;

        pc16PrefitOfGAL.header                    =   TypeID::prefitC16;
        pc16PrefitOfGAL.body[TypeID::prefitC1]    =   +ae16;
        pc16PrefitOfGAL.body[TypeID::prefitC6]    =   -be16;

         // Definition to compute prefit residual of Galileo LC, L1 + L5
        lc15PrefitOfGAL.header                    =   TypeID::prefitL15;
        lc15PrefitOfGAL.body[TypeID::prefitL1]    =   +ae15;
        lc15PrefitOfGAL.body[TypeID::prefitL5]    =   -be15;

         // Definition to compute prefit residual of Galileo LC, L1 + L7
        lc17PrefitOfGAL.header                    =   TypeID::prefitL17;
        lc17PrefitOfGAL.body[TypeID::prefitL1]    =   +ae17;
        lc17PrefitOfGAL.body[TypeID::prefitL7]    =   -be17;

         // Definition to compute prefit residual of Galileo LC, L1 + L8
        lc18PrefitOfGAL.header                    =   TypeID::prefitL18;
        lc18PrefitOfGAL.body[TypeID::prefitL1]    =   +ae18;
        lc18PrefitOfGAL.body[TypeID::prefitL8]    =   -be18;

         // Definition to compute prefit residual of Galileo LC, L1 + L6
        lc16PrefitOfGAL.header                    =   TypeID::prefitL16;
        lc16PrefitOfGAL.body[TypeID::prefitL1]    =   +ae16;
        lc16PrefitOfGAL.body[TypeID::prefitL6]    =   -be16;

        // BDS-related combination

        pc27PrefitOfBDS.header                    =   TypeID::prefitC27;
        pc27PrefitOfBDS.body[TypeID::prefitC2]    =   +ac27;
        pc27PrefitOfBDS.body[TypeID::prefitC7]    =   -bc27;

        pc26PrefitOfBDS.header                    =   TypeID::prefitC26;
        pc26PrefitOfBDS.body[TypeID::prefitC2]    =   +ac26;
        pc26PrefitOfBDS.body[TypeID::prefitC6]    =   -bc26;

         // Definition to compute prefit residual of BDS LC, L2 + L7
        lc27PrefitOfBDS.header                    =   TypeID::prefitL27;
        lc27PrefitOfBDS.body[TypeID::prefitL2]    =   +ac27;
        lc27PrefitOfBDS.body[TypeID::prefitL7]    =   -bc27;


        lc26PrefitOfBDS.header                    =   TypeID::prefitL26;
        lc26PrefitOfBDS.body[TypeID::prefitL2]    =   +ac26;
        lc26PrefitOfBDS.body[TypeID::prefitL6]    =   -bc26;


         // Definition to compute prefit residual of GPS MW, L1+L2
        wl12PrefitOfGPS.header                    =   TypeID::prefitWL12;
        wl12PrefitOfGPS.body[TypeID::prefitL1]    =   +cg12;
        wl12PrefitOfGPS.body[TypeID::prefitL2]    =   -dg12;

         // Definition to compute prefit residual of GAL MW, L1+L5
        wl15PrefitOfGAL.header                    =   TypeID::prefitWL15;
        wl15PrefitOfGAL.body[TypeID::prefitL1]    =   +ce15;
        wl15PrefitOfGAL.body[TypeID::prefitL5]    =   -de15;

         // Definition to compute prefit residual of BDS MW, L2+L7
        wl27PrefitOfBDS.header                    =   TypeID::prefitWL27;
        wl27PrefitOfBDS.body[TypeID::prefitL2]    =   +cc27;
        wl27PrefitOfBDS.body[TypeID::prefitL7]    =   -dc27;

         // Definition to compute prefit residual of GPS MW, L1+L2
        mw12PrefitOfGPS.header                     =   TypeID::prefitMW12;
        mw12PrefitOfGPS.body[TypeID::MW12]         =   +1.0;
        mw12PrefitOfGPS.body[TypeID::instMW12]     =   +1.0;

         // Definition to compute prefit residual of GPS MW, L1+L5
        mw15PrefitOfGPS.header                     =   TypeID::prefitMW15;
        mw15PrefitOfGPS.body[TypeID::MW15]         =   +1.0;
        mw15PrefitOfGPS.body[TypeID::instMW15]     =   +1.0;

         // Definition to compute prefit residual of Galileo MW, L1+L5
        mw15PrefitOfGAL.header                     =   TypeID::prefitMW15;
        mw15PrefitOfGAL.body[TypeID::MW15]         =   +1.0;
        mw15PrefitOfGAL.body[TypeID::instMW15]     =   +1.0;

         // Definition to compute prefit residual of BDS MW, L2+L7
        mw27PrefitOfBDS.header                     =   TypeID::prefitMW27;
        mw27PrefitOfBDS.body[TypeID::MW27]         =   +1.0;
        mw27PrefitOfBDS.body[TypeID::instMW27]     =   +1.0;


    }  // End of constructor 'LinearCombinations::LinearCombinations()'


      // Return the frequency of the combination in cycles: i * L1 + j * L2
    double LinearCombinations::freqOfLC(int i, int j, double f1 , double f2 )
    {
        return ( double(i)*f1+double(j)*f2 );
    }

    /// Return the wavelength of the combination in cycles: i * L1 + j * L2
    double LinearCombinations::wavelengthOfLC(int i,int j,double f1,double f2)
    {
        return C_MPS / freqOfLC(i,j,f1,f2);
    }

    /// Return the f1 factor of the combination in cycles: i * L1 + j * L2
    double LinearCombinations::firstFactorOfLC(int i,int j,double f1,double f2)
    {
        return double(i)*f1/freqOfLC(i,j,f1,f2);
    }

    /// Return the f2 factor of the combination in cycles: i * L1 + j * L2
    double LinearCombinations::secondFactorOfLC(int i,int j,double f1,double f2 )
    {
        return double(j)*f2/freqOfLC(i,j,f1,f2);
    }

} // End of namespace gpstk
